package com.example.springboot_zc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot_zc.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface userMapper extends BaseMapper<User> {

    @Select("SELECT username,password,name,major,college,class_num as classNum,phone,address,status,idcard FROM user WHERE username=#{username} ")
    public User findName(String username);

    @Select("SELECT username,password,name,major,college,class_num as classNum,phone,address,status,idcard FROM user WHERE username=#{username} and idcard=#{idcard} ")
    public Integer updatapassword(String username,String idcard);

    @Update("update user set filename = #{filename} where username = #{username}")
    public Boolean UpdateFileName(String filename,String username);

    @Update("update user set password = #{password} where username= #{username}")
    public Integer updatapa(String username,String password);

    @Update("update user set address = #{address}, phone = #{phone} where username=#{username}")
    public Integer updataMine(String phone,String address,String username);
}
